﻿using MediatR;
using RBAC.LuFang.API.Application.Command.RoleCommand;
using RBAC.LuFang.Domain;
using RBAC.LuFang.Domin.Services;

namespace RBAC.LuFang.API.Application.CommandHandlers.RoleHandler
{
    //反填
    public class RoleFanCommandHandler:IRequestHandler<RoleFanCommand,Role>
    {
        private readonly IRoleService _roleService;

        public RoleFanCommandHandler(IRoleService roleService)
        {
            _roleService = roleService;
        }

        async Task<Role> IRequestHandler<RoleFanCommand, Role>.Handle(RoleFanCommand request, CancellationToken cancellationToken)
        {
            return await _roleService.GetByid(request.id);
        }
    }
}
